package controlLayer;
import modelLayer.*;


public class ProductCtr {
    
    private ProductContainer prodCont;
    
    public ProductCtr() {
        prodCont = ProductContainer.getInstance();
    }
    
    public void createProduct(String name, int barcode, double price, String locationCode, int inStock) {
        Product prod = new Product(name, barcode, price, locationCode, inStock);
        prodCont.addProduct(prod);
    }
    
    public Product findProduct(int barcode) {
        Product prod = prodCont.findProduct(barcode);
        return prod;
    }
    
    public void removeProduct(int barcode) {
        Product prod = findProduct(barcode);
        prodCont.removeProduct(prod);
    }
    
    public OrderLine createOrderLine(Product prod, int quantity) {
        OrderLine ol = new OrderLine(prod, quantity);
        return ol;
    }
    
}
